#ifndef CLIENT_H
#define CLIENT_H

#include <my_header.h>

typedef struct train_s {
    int length;
    char data[1000];
} train_t;


typedef struct user_t {
    char userName[128];
    char passwd[1024];
} user_t;


/* trainsmission.c */
int sendMessageToServer(int fd, char *buf, int sendLength);       // 发消息
int sendFileToServer(int fd, char *localPath, char *virtualPath); // 发文件
int changeToMd5(char *localPath, char *fileMd5);
ssize_t recvStdin(char *buf, int bufLength);                      // 收标准输入
ssize_t recvMessageFromServer(int fd, char *buf, int bufLength);  // 收消息
int recvFileFromServer(int fd);                                   // 收文件


/* tcpepoll.c */
int tcpClientInit(char *ip, char *port, int *pSocketFd); // TCP 连接
int epollAdd(int epfd, int fd);                          // 添加监听
int epollDelete(int epfd, int fd);                       // 删除监听


/* login.h */
int enterUser(user_t *user);

/* command.c */
int cutCmd(char *input,char *cmd,char *path1,char *path2);
int checkCmd(const char *cmd);
int checkArguments(const char *cmd, const char *path1, const char *path2, int cutRet);
int cutTail(char *path, char *left, char *right);
#endif
